﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DatabaseManager;
using Physio10Context;

namespace Physio_Clinic
{
    public partial class InvoiceDetail_WebForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["currentOrderDetail"] != null && !Page.IsPostBack)
            {
                Drugorderdetail orderDetail = (Drugorderdetail)Session["currentOrderDetail"];
                ProductNameLabel.Text = orderDetail.ProductName;
                AmountTxt.Text = orderDetail.Amount.ToString();
                DiscountTxt.Text = orderDetail.Discount.ToString();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Drugorderdetail orderDetail = (Drugorderdetail)Session["currentOrderDetail"];

            orderDetail.Amount = Convert.ToInt32(AmountTxt.Text);
            orderDetail.Discount = DiscountTxt.Text;

            PersistentManager.Instance.Save();

            Response.Redirect("Invoice.aspx");

        }

        protected void Button2_Click1(object sender, EventArgs e)
        {
            Response.Redirect("Invoice.aspx");
        }
    }
}